#include "LightFinalPassInclude.hlsli"

float4 main(LightFinalPassInputPS input) : SV_TARGET0
{
	float4 diffuseColor = diffuseTexture.Sample(linearSampler, input.texCoord).rgba;
	float4 lightBufferValue = lightBuffer.Load(int3(input.position.xy, 0));

	float4 oc = overrideColor * overridePercentAndDiffusePercent.x;
	float4 dc = diffuseColor * overridePercentAndDiffusePercent.y;
	float4 lb_amb = float4(saturate(lightBufferValue.rgb  + ambientColor.rgb), 1.0f);
	float4 sc = float4(specularColor * lightBufferValue.a, 0.0f);
	return ((oc + dc) * lb_amb + sc) * diffuseTint;
}
